import request from '@/config/axios'

export interface MarketingOrderAlterProductVO {
  productNumber: string
  productName: string
  productStandard: string
  partUnit: string
  orderQuantity: number
  deliveryDate: string
  dictChangeType: number
  version: string
  dictDeliveryProjectType: number
  quotation: number
  taxIncludedPrice: number
  priceTaxTotal: number
  taxRate: number
  dictStatus: number
  remark: string
  orderChangePerson: string
  orderChangeDate: string
  isNew: boolean
  isEdit: boolean
}

// 查询订单管理-营销管理-订单变更列表
export const getMarketingOrderAlterPage = async (params) => {
  return await request.get({ url: `/order/order-change/page`, params })
}

// 查询订单管理-营销管理-订单变更详情
export const getMarketingOrderAlter = async (params) => {
  return await request.get({ url: `/order/order-change/getDetail`, params })
}

// 新增订单管理-营销管理-订单变更
export const createMarketingOrderAlter = async (data) => {
  return await request.post({ url: `/order/order-change/create`, data })
}

// 新增时查询订单关联产品
export const getMarketingOrderAlterRelationProduct = async (orderNumber: string) => {
  return await request.get({ url: `/order/product-relation/getDetailByChange?orderNumber=${orderNumber}` })
}

// 查询订单列表
export const getMarketingOrderAlterOrderNumber = async (params) => {
  return await request.get({ url: `/order/marketing-order-info/change-list`, params })
}

// 导出订单管理-营销管理-订单变更 Excel
export const exportMarketingOrderAlter = async (data) => {
  return await request.download({ url: `/order/order-change/export-excel`, data })
}
